<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<!-- author:cnsecer.com -->
<html lang="zh_cn">
<head>
	<meta charset="UTF-8">
	<title>管理员登陆</title>
	<link rel="shortcut icon" href="/ThinkBlog/Application/Admin/View//Public/images/favicon.ico">
	<link rel="stylesheet" href="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/css/flat-ui.css">
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/js/html5shiv.js"></script>
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/Flat-UI-master/js/respond.min.js"></script>
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/jquery.form.js"></script>
	<script type="text/javascript" src="/ThinkBlog/Application/Admin/View//Public/init.js"></script>
	<style>
		body{ background-color: #1abc9c;font-family: "Microsoft YaHei",Verdana,Arial,Helvetica,sans-serif;}
		.login-form:before{content:none;}
		#title{text-align: center;margin: 50px 0 20px 0;}
		#footer{margin-top: 130px;text-align: center;}
		#result{display: none; color: #fff;padding: 10px; border-radius: 10px;position: fixed;width: 252px;height: 50px;background: #444;opacity: 0.5;top: 10px;right: 10px;}
	</style>
</head>

<body>
<div class="container">
	<div class="row">
		<div class="col-md-4"></div>
		<div class="col-md-4">
		<h2 id="title">管理员登陆 </h2>
		<form class="login-form" action="/ThinkBlog/Admin/Login/login" method="post" >
		    <div class="form-group">
		      <input type="text" name="username" class="form-control login-field" value="" placeholder="用户名" id="login-name">
		      <label class="login-field-icon fui-user" for="login-name"></label>
		    </div>
		    <div class="form-group">
		      <input type="password" name="password" class="form-control login-field" value="" placeholder="密码" id="login-pass">
		      <label class="login-field-icon fui-lock" for="login-pass"></label>
		    </div>
		    <div class="form-group">
		      <input type="text" name="verify" class="form-control login-field" value="" placeholder="验证码" id="login-verify">
		      <label class="login-field-icon fui-check-inverted" for="login-pass"></label>
		    </div>
		    <div class="form-group">
			 <a href="javascript:void(change_code(this));"><img src="<?php echo U(MODULE_PATH .'/Login/verify');?>" id="code"/></a>
		   	</div>
		    <input type="submit" class="btn btn-primary btn-lg btn-block" value="登 &nbsp;&nbsp;&nbsp; 陆">	

		</form>	
		<p id="footer">Power by <a href="http://www.cnsecer.com" target="_blank">ThinkBlog</a></p>	
		</div>
		<div class="col-md-4">
			<div id="result">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
			</div>
		</div>
	</div>
</div>

	<script type="text/javascript">
	//验证码
		verifyURL = '/ThinkBlog/Admin/Login/verify';
		function change_code(obj) {
	    	$("#code").attr("src", verifyURL + "/" + Math.random());
	    return false;
		}
	//ajax
	    $(function(){
        $('.login-form').ajaxForm({
            beforeSubmit:  checkForm,  // 此方法主要是提交前执行的方法，根据需要设置
            success:       complete,  // 这是提交后的方法
            dataType: 'json'
        });
        function checkForm(){
            //add ....
        }
        function complete(data){
            if (data.status==1){
                $('#result').html(data.info).show();
                location.href = '/ThinkBlog/Admin'; 
            }else{
                $('#result').html(data.info).show();
            }
        }
        $("#result").click(function(event) {
        	$(this).hide(400);
        });
    });
	</script>
</body>
</html>